package com.vcredit.creditcat.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.vcredit.creditcat.framework.pagination.Criteria;
import com.vcredit.creditcat.framework.pagination.Page;
import com.vcredit.creditcat.vo.ChanneManVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vcredit.creditcat.model.ChannelStatisticsOwner;
import com.vcredit.creditcat.persistence.base.ChannelStatisticsOwnerMapper;

import javax.servlet.http.HttpServletRequest;

/**
 * 
 **/
@Service
public class ChannelStatisticsOwnerService {
	@Autowired
    private ChannelStatisticsOwnerMapper mapper;

	public List<ChannelStatisticsOwner> findByTime(HttpServletRequest request) {
		List<ChannelStatisticsOwner> chioList = mapper.findByTime(request.getParameter("startTime"),request.getParameter("endTime"));
		return chioList;
	}
    
    public List<ChannelStatisticsOwner> findAll(){
		return mapper.findAll();
	}
	
	public List<ChannelStatisticsOwner> find(ChannelStatisticsOwner obj){
		return mapper.find(obj);
	}

	public Page<ChannelStatisticsOwner> findByPage(Criteria criteria) throws Exception {
		List<ChannelStatisticsOwner> mpo = mapper.findByPage(criteria);
		Long li = mapper.findByPageCount(criteria);
		return new Page<ChannelStatisticsOwner>(li, mpo);
	}
}